package com.example.qt.ptplatform.controller;

import com.example.qt.ptplatform.service.impl.InviteCodeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.example.qt.ptplatform.utils.JsonResult;

@RestController
@RequestMapping(value = "invitecode")
public class InviteCodeController {
    @Autowired
    private InviteCodeServiceImpl inviteCodeService;

    // 生成邀请码
    @PostMapping("/generatecode")
    public JsonResult generateInviteCode(@RequestParam Integer user_id) {
        return inviteCodeService.generateInviteCode(user_id);
    }

//    // 验证邀请码
//    @PostMapping("/validatecode")
//    public JsonResult validateInviteCode(@RequestParam String inviteCode) {
//        return inviteCodeService.validateInviteCode(inviteCode);
//    }
}
